<?php
defined('IN_PHPCMS') or exit('No permission resources.'); 
pc_base::load_app_class('admin', 'admin', 0);
class review_admin extends admin {
	function __construct() {
		parent::__construct();
		$this->db = pc_base::load_model('review_model');
	}
	
	public function init() {
		
		$data = $this->db->listinfo($where, $order, $page, 10);
		$pages = $this->db->pages;
		include $this->admin_tpl('review_list');
	}


	public function del() {
		if (isset($_GET['dosubmit']) && $_GET['dosubmit']) {
			$ids = $_GET['ids'];
			if (is_array($ids)) {
				foreach ($ids as $id) {
					$this->db->delete(array('id'=>$id));
				}
				$ids = implode(',', $ids);
			} elseif (is_numeric($ids)) {
				$id = intval($ids);
				$this->db->delete(array('id'=>$id));
			} else {
				showmessage(L('illegal_operation'));
			}
			showmessage(L('operation_success'), HTTP_REFERER);
		}
	}
}